1. Field of the Invention
The present invention generally relates to a method for updating query results.
2. Description of the Related Art
Databases are computerized information storage and retrieval systems. A relational database management system is a computer database management system (DBMS) that uses relational techniques for storing and retrieving data. The most prevalent type of database is the relational database, a tabular database in which data is defined so that it can be reorganized and accessed in a number of different ways.
Regardless of the particular architecture, in a DBMS, a requesting entity (e.g., an application or the operating system) demands access to a specified database by issuing a database access request. Such requests may include, for instance, simple catalog lookup requests or transactions and combinations of transactions that operate to read, change and add specified records in the database. These requests are made using high-level query languages such as the Structured Query Language (SQL). Illustratively, SQL is used to make interactive queries for getting information from and updating a database such as International Business Machines' (IBM) DB2, Microsoft's SQL Server, and database products from Oracle, Sybase, and Computer Associates. The term “query” denominates a set of commands for retrieving data from a stored database. Queries take the form of a command language that lets programmers and programs select, insert, update, find out the location of data, and so forth.
Information in a database may be constantly changing. For instance, in a database that stores medical records, new records may be added, old records may be deleted, and existing records may be updated with new information such as test results. A user executing queries against the database may wish to remain up-to-date with respect to the latest information in the database. For instance, the user may wish to remain up-to-date because the user may be conducting ongoing research using the database. One method for keeping the user up-to-date with respect to information in the database is to allow the user to store queries which the user has executed against the database. The user may run a query once to obtain an initial set of results and the user may decide to store the query. Later, the user may run the stored query again to obtain a new set of results. The user may also wish to store the results of the initial query execution for later reference, analysis, or comparison with subsequent results. The results stored by the user may be stored in a table consisting of several rows and columns of data.
In some cases, the user may wish to obtain updated results, but the user may not want to update the entire table of stored results. For instance, the user may only be interested in updating certain rows in the stored results because those rows contain information, such as test results, which the user is tracking. For instance, the user may wish to update results only with respect to a certain patient that the user is interested in. Where the results contain several rows for a single patient, representing different test dates for instance, the user may only wish to update results for those test dates. In other cases, the user may also wish to have outdated rows removed and to be informed of any new rows which have been added. If the user wants to update those desired rows, the user may have to rerun the stored query and update the entire table.
Rerunning the stored query may be costly. For instance, the stored query may be executed against a database with many tables and many records. The stored query may require many comparisons and calculations to be performed as well. When the user only wishes to see updated results for certain rows in the stored results, the user would prefer not to have to run the stored query and update the entire set of results because of the associated execution costs. Accordingly, what is needed is a method for updating results wherein the user only wishes to update a selection of the rows in the results.